<?php
//var_dump(imap_utf7_decode('&i6KWBZCuTvY-'));
var_dump(mb_convert_encoding('&i6KWBZCuTvY-', "gb2312","UTF7-IMAP"));

$mbox = imap_open ("{imap.163.com:143/imap}INBOX", "13632241880", "he110w0r1d");
//$mbox = imap_open ("{imap.163.com}INBOX", "13632241880", "he110w0r1d");
//imap_ping($mbox);
//var_dump(imap_headers($mbox));
//var_dump(imap_num_recent($mbox));
$list=imap_list ($mbox,'{imap.163.com}',"*");
var_dump($list);
if (is_array($list)) {
    foreach ($list as $val) {
        //echo imap_utf7_decode($val) . "\n";
	var_dump(mb_convert_encoding($val, "gb2312","UTF7-IMAP"));
    }
}

//} else {
//    echo "imap_list failed: " . imap_last_error() . "\n";
//}
//var_dump(imap_num_msg($mbox));
//var_dump(imap_getsubscribed ($mbox));
//var_dump(imap_lsub  ($mbox,'{imap.163.com}','*'));
?>